package br.usp.ime.protoc.neuroimagem;

import com.google.gwt.user.client.rpc.IsSerializable;


public class Intercorrencia implements IsSerializable
{
   private String descricao;

   public String getDescricao()
   {
      return this.descricao;
   }

   public void setDescricao(String value)
   {
      if (this.descricao != value)
      {
         
         this.descricao = value;
         
      }
   }

   /**
    * <pre>
    *                 1..*          has           1 
    * Intercorrencia ------------------------------- Sequencia
    *                 intercorrencia      sequencia 
    * </pre>
    */
   private Sequencia sequencia;

   public Sequencia getSequencia()
   {
      return this.sequencia;
   }

   public boolean setSequencia(Sequencia value)
   {
      boolean changed = false;
      if (this.sequencia != value)
      {
         Sequencia oldValue = this.sequencia;
         
         if (this.sequencia != null)
         {
            this.sequencia = null;
            oldValue.removeFromIntercorrencia (this);
         }
         this.sequencia = value;
         if (value != null)
         {
            value.addToIntercorrencia (this);
         }
         changed = true;
         
      }
      return changed;
   }

   public void removeYou()
   {
      Sequencia tmpSequencia = getSequencia ();
      if (tmpSequencia != null)
      {
         setSequencia (null);
      }
   }

}
